<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>数组</title>
    <script>
        /*
        ...展开运算符：可以将一个数组中的元素展开到另一个数组中或者作为函数的参数传递
        */

        const arr = [10,20,30]

        function sum(a,b,c){
            return a+b+c
        }

        let result = sum(...arr)
        console.log(result) //60

        const arr2 = [...arr,40,50]
        console.log(arr2)   
    </script>
</head>
<body>
    
</body>
</html>